package com.liliya.servlet.pro;

import com.liliya.service.ProService;
import com.liliya.service.impl.ProServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Description TODO
 * @Author hhy
 * @Date 2021/1/15 9:09
 */
@WebServlet(urlPatterns = "/pro/del")
public class ProDelServlet extends HttpServlet {
      private ProService proService = new ProServiceImpl();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String pronum = req.getParameter("pronum");
        proService.deletePro(Integer.parseInt(pronum));
        resp.sendRedirect("./search");
    }
}
